<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML >
<html> 
<head> 
<title>Login</title>
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<%@ page isELIgnored="false" %> 
</head> 

<body>
   <!DOCTYPE html>
<html>
<head>
  <title>Bootstrap 实例</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0-beta/css/bootstrap.min.css">
  <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
</head>
<style>
 .errMsg{
   color: red;
 }
</style>
<body>
<div class="container">
  <h2>登录</h2>
  <form action="${pageContext.request.contextPath}/user/login.shtml" method="POST">
    <div class="form-group">
      <label for="username">用户名:</label>
      <input type="username" class="form-control" name="username" style="width: 200px;" id="username" placeholder="Enter username">
    </div>
    <div class="form-group">
      <label for="pwd">密码:</label>
      <input type="password" class="form-control" name="password" style="width: 200px;" id="password" placeholder="Enter password">
    </div>
    <button type="submit"  class="btn btn-primary">登录</button>
  </form>
  <div class="errMsg">${errorInfo}</div>
</div>

</body>
<script type="text/javascript">
 /* function login() {
	 $.ajax({
         url: "${pageContext.request.contextPath}/admin/user/login.shtml",
         type: "get",
         dataType: "json",
         data: {
       	  "username":$("#username").val(),
       	  "password":$("#password").val()
         },
         success: function (data) {
        	  if(data=="success"){
        		 location.href="${pageContext.request.contextPath}/admin/user/main.shtml";
        	 }else{
        		 alert("登录失败!");
        	 }
        	
         } 
     });
} */
</script>
</html>  
</body>  
</html>
